﻿@model online_magazine1.Models.Article

<h2>Create</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm("Create", "ArticleManager", FormMethod.Post, new { enctype = "multipart/form-data" }))
{

    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Article</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.ThemeId, "Theme")
        </div>
        <div class="editor-field">
            @Html.DropDownList("ThemeId", String.Empty)
            @Html.ValidationMessageFor(model => model.ThemeId)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.MainText)
        </div>
        <div class="editor-field">
            
            @Html.TextAreaFor(model => model.MainText, 20, 100, null)
            @Html.ValidationMessageFor(model => model.MainText)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Title)
            @Html.ValidationMessageFor(model => model.Title)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)
        </div>
        <p>
            <input type="file" id="file" name="file" />
        </p>
        <p>
            <input type="submit" value="Create"/>
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
